﻿//var _requestName = "org.qsoft.rpcfx.core.BaseServiceRequest";
//var _serviceName = "serviceName":
//var _methodName  = "methodName";
//var _paramTypeNames = "paramTypeNames";
//var _args = "args";

var _server = "http://localhost:2693/rpcfxweb/qsoft.rpc";



function createRequest(serviceName,methodName,paramTypeNames,args)
{
    
    var s = "<org.qsoft.rpcfx.core.BaseServiceRequest>\n";
    
    s += "<serviceName><string>" + serviceName +  "</string></serviceName>\n";
    s += "<methodName><string>" + methodName + "</string></methodName>\n";
    s += "<paramTypeNames>\n";
    for(var i = 0;i<paramTypeNames.length;i++)
    {
        s+="<value><string>" + paramTypeNames[i] + "</string></value>\n";
    }
    s += "</paramTypeNames>\n";
    
    s += "<args>\n";
    for(var i = 0;i<paramTypeNames.length;i++)
    {
        s+="<value><"+ paramTypeNames[i] +">" + args[i] + "</" + paramTypeNames[i] + "></value>\n";
    }
    s += "</args>\n";
    
    s += "</org.qsoft.rpcfx.core.BaseServiceRequest>\n";
    return s;

}

function each(arr,f)
{
    for(var i = 0;i<arr.length;i++)
    {
        f(arr[i]);
    }
}